Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading WWI scenario #748

Merged
merged 4 commits into from
Nov 28, 2021

Conversation

lmoureaux
Copy link
Contributor

@lmoureaux lmoureaux commented Nov 21, 2021

Collection of patches related to Freeciv(.org)'s new AI types "threaded" and "tex" that are not supported in fc21. Basically we always fall back to the classic AI, and only mention "classic" in our scenarios.

Closes #746.

Test plan:

  • Save old Europe 1900 scenario somewhere else
  • Checkout and build new code
  • Load old Europe 1900
  • Load new Europe 1900

Allow players to load scenarios (and saves) even if the chosen AI type is not
supported. In other words: "be liberal in what we accept."

In longturn#746, trying to load a scenario using the "tex" AI failed because we don't
build it for fc21. If the user really wants another AI, s.he can switch back in
pregame. Scenarios that really want to lock down their AIs retain this
capability.
"classic" is the only AI available in fc21 anyway. It's better to load the
game slightly wrong than to fail to load it because of an unsupported AI type.
See longturn#746.
@jwrober
Copy link
Collaborator

jwrober commented Nov 21, 2021

Is this problem in any of the other built-in scenarios that should be fixed now as well?

@lmoureaux
Copy link
Contributor Author

Is this problem in any of the other built-in scenarios that should be fixed now as well?

$ grep -r '"tex"' data/scenarios/
$

No (and they'd load anyway).

// Get pointer to persistent name of the ai_type
return ai_name(fb);
}
auto fb = ai_type_by_name("classic");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log a warning when doing this.

@lmoureaux lmoureaux merged commit a4b9372 into longturn:master Nov 28, 2021
@lmoureaux lmoureaux deleted the bugfix/load-wwi-scenario branch November 28, 2021 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large Scenario (Europe 1900) won't open
3 participants